package com.lp.common.config;

import com.lp.common.Constants;
import com.lp.common.interceptor.LoginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class LoginInterceptorConfig implements WebMvcConfigurer, Constants {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {

        //添加拦截器
        registry.addInterceptor(new LoginInterceptor()).excludePathPatterns(CHECKED_LONGIN_EXCLUDE_PATH)
                .addPathPatterns(CHECKED_LONGIN_INCLUDE_PATH);

    }
}
